From a48eaa195417396bdb43b760de45aabc85cda7f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20=C3=85dahl?= Date: Wed, 14 Mar 2018 11:54:02 +0800 Subject: [PATCH] entrycompletion: Realize popup after setting screen Realization is done as a side effect of calling _gtk_entry_completion_resize_popup(), but if this is done before the GdkScreen of the GtkWindow is set up correctly, it may result in the widget being unrealized when the screen is updated. This may happen when the file dialog parent window is not using the default GdkDisplay. To avoid this issue, realize the popup after the screen has been properly set up. Fixes #83 in gtk4 --- gtk/gtkentrycompletion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index 32d564b7c1..a5e6aa68af 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -1514,8 +1514,6 @@ gtk_entry_completion_popup (GtkEntryCompletion *completion) /* default on no match */ completion->priv->current_selected = -1; - _gtk_entry_completion_resize_popup (completion); - toplevel = gtk_widget_get_toplevel (completion->priv->entry); if (GTK_IS_WINDOW (toplevel)) { @@ -1529,6 +1527,8 @@ gtk_entry_completion_popup (GtkEntryCompletion *completion) gtk_widget_get_display (completion->priv->entry)); gtk_widget_realize (completion->priv->popup_window); + _gtk_entry_completion_resize_popup (completion); + if (completion->priv->device) { gtk_grab_add (completion->priv->popup_window); -- 2.30.2